package com.dcy.daily.skill.rabbitMQ.springAMQP.tmp.sendAndRecv;

import com.dcy.daily.skill.rabbitMQ.springAMQP.util.AmqpUtil;
import org.springframework.amqp.rabbit.core.RabbitTemplate;

/**
 * 接收消息
 * @author duanchunyu
 * @version 1.0.0
 * @createTime 2021年07月22日 11:14
 */
public class Recv {
    public static void main(String[] args) {
        RabbitTemplate rabbitTemplate = AmqpUtil.getRabbitTemplate();
        boolean ret = rabbitTemplate.receiveAndReply("myqueue", (byte[] t) -> {
            String foo = new String(t);
            System.out.println(foo);
            return foo;
        });
    }
}
